﻿using System;
using System.Collections.Generic;
using System.Text;

namespace JWFW.Model.Register
{
    /// <summary>
    /// 已WebPage作为远程服务的方式的代理类
    /// </summary>
    public class ValidateRegWebPage : IValidateReg
    {
        protected string m_url = "";
        protected SFL.HttpOP m_http = new JWFW.SFL.HttpOP();

        #region IValidateReg 成员

        public string Url
        {
            get
            {
                return m_url;
            }
            set
            {
                m_url = value;
            }
        }

        public string GetNewVersionUrl(string clientInfo)
        {
            return this.Visit("GetNewVersionUrl", clientInfo);
        }

        public string TrialAccount(string clientInfo)
        {
            return this.Visit("TrialAccount", clientInfo);
        }

        public string ValidateAccount(string clientInfo)
        {
            return this.Visit("ValidateAccount", clientInfo);
        }

        public string GetInfo(string clientInfo)
        {
            return this.Visit("GetInfo", clientInfo);
        }

        protected string Visit(string method, string arg)
        {
            return m_http.NavigateString(string.Format("{0}?method={1}&arg0={2}", m_url, method, arg));
        }

        #endregion
    }
}
